<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QTextEdit Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QTextEdit Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTextEdit class provides a widget that is used to edit and
display both plain and rich text. <a href="#details">More...</a></p>

<p>Inherits <a href="qabstractscrollarea.html">QAbstractScrollArea</a>.</p><p>Inherited by <a href="qtextbrowser.html">QTextBrowser</a>.</p><h3>Types</h3><ul><li><div class="fn" />class <b><a href="qtextedit-autoformatting.html">AutoFormatting</a></b></li><li><div class="fn" />enum <b><a href="qtextedit.html#AutoFormattingFlag-enum">AutoFormattingFlag</a></b> { AutoNone, AutoBulletList, AutoAll }</li><li><div class="fn" />class <b><a href="qtextedit-extraselection.html">ExtraSelection</a></b></li><li><div class="fn" />enum <b><a href="qtextedit.html#LineWrapMode-enum">LineWrapMode</a></b> { NoWrap, WidgetWidth, FixedPixelWidth, FixedColumnWidth }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtextedit.html#QTextEdit">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qtextedit.html#QTextEdit-2">__init__</a></b> (<i>self</i>, QString&#160;<i>text</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />bool <b><a href="qtextedit.html#acceptRichText">acceptRichText</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.Alignment <b><a href="qtextedit.html#alignment">alignment</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qtextedit.html#anchorAt">anchorAt</a></b> (<i>self</i>, QPoint&#160;<i>pos</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#append">append</a></b> (<i>self</i>, QString&#160;<i>text</i>)</li><li><div class="fn" />AutoFormatting <b><a href="qtextedit.html#autoFormatting">autoFormatting</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a></b> (<i>self</i>, QMimeData&#160;<i>source</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#canPaste">canPaste</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#changeEvent">changeEvent</a></b> (<i>self</i>, QEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#clear">clear</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#contextMenuEvent">contextMenuEvent</a></b> (<i>self</i>, QContextMenuEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#copy">copy</a></b> (<i>self</i>)</li><li><div class="fn" />QMimeData <b><a href="qtextedit.html#createMimeDataFromSelection">createMimeDataFromSelection</a></b> (<i>self</i>)</li><li><div class="fn" />QMenu <b><a href="qtextedit.html#createStandardContextMenu">createStandardContextMenu</a></b> (<i>self</i>)</li><li><div class="fn" />QMenu <b><a href="qtextedit.html#createStandardContextMenu-2">createStandardContextMenu</a></b> (<i>self</i>, QPoint&#160;<i>position</i>)</li><li><div class="fn" />QTextCharFormat <b><a href="qtextedit.html#currentCharFormat">currentCharFormat</a></b> (<i>self</i>)</li><li><div class="fn" />QFont <b><a href="qtextedit.html#currentFont">currentFont</a></b> (<i>self</i>)</li><li><div class="fn" />QTextCursor <b><a href="qtextedit.html#cursorForPosition">cursorForPosition</a></b> (<i>self</i>, QPoint&#160;<i>pos</i>)</li><li><div class="fn" />QRect <b><a href="qtextedit.html#cursorRect">cursorRect</a></b> (<i>self</i>, QTextCursor&#160;<i>cursor</i>)</li><li><div class="fn" />QRect <b><a href="qtextedit.html#cursorRect-2">cursorRect</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextedit.html#cursorWidth">cursorWidth</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#cut">cut</a></b> (<i>self</i>)</li><li><div class="fn" />QTextDocument <b><a href="qtextedit.html#document">document</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qtextedit.html#documentTitle">documentTitle</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#dragEnterEvent">dragEnterEvent</a></b> (<i>self</i>, QDragEnterEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#dragLeaveEvent">dragLeaveEvent</a></b> (<i>self</i>, QDragLeaveEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#dragMoveEvent">dragMoveEvent</a></b> (<i>self</i>, QDragMoveEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#dropEvent">dropEvent</a></b> (<i>self</i>, QDropEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#ensureCursorVisible">ensureCursorVisible</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#event">event</a></b> (<i>self</i>, QEvent&#160;<i>e</i>)</li><li><div class="fn" />list-of-QTextEdit.ExtraSelection <b><a href="qtextedit.html#extraSelections">extraSelections</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#find">find</a></b> (<i>self</i>, QString&#160;<i>exp</i>, QTextDocument.FindFlags&#160;<i>options</i>&#160;=&#160;0)</li><li><div class="fn" /><b><a href="qtextedit.html#focusInEvent">focusInEvent</a></b> (<i>self</i>, QFocusEvent&#160;<i>e</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#focusNextPrevChild">focusNextPrevChild</a></b> (<i>self</i>, bool&#160;<i>next</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#focusOutEvent">focusOutEvent</a></b> (<i>self</i>, QFocusEvent&#160;<i>e</i>)</li><li><div class="fn" />QString <b><a href="qtextedit.html#fontFamily">fontFamily</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#fontItalic">fontItalic</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtextedit.html#fontPointSize">fontPointSize</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#fontUnderline">fontUnderline</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextedit.html#fontWeight">fontWeight</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#inputMethodEvent">inputMethodEvent</a></b> (<i>self</i>, QInputMethodEvent)</li><li><div class="fn" />QVariant <b><a href="qtextedit.html#inputMethodQuery">inputMethodQuery</a></b> (<i>self</i>, Qt.InputMethodQuery&#160;<i>property</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a></b> (<i>self</i>, QMimeData&#160;<i>source</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#insertHtml">insertHtml</a></b> (<i>self</i>, QString&#160;<i>text</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#insertPlainText">insertPlainText</a></b> (<i>self</i>, QString&#160;<i>text</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#isReadOnly">isReadOnly</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextedit.html#isUndoRedoEnabled">isUndoRedoEnabled</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#keyPressEvent">keyPressEvent</a></b> (<i>self</i>, QKeyEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#keyReleaseEvent">keyReleaseEvent</a></b> (<i>self</i>, QKeyEvent&#160;<i>e</i>)</li><li><div class="fn" />int <b><a href="qtextedit.html#lineWrapColumnOrWidth">lineWrapColumnOrWidth</a></b> (<i>self</i>)</li><li><div class="fn" />LineWrapMode <b><a href="qtextedit.html#lineWrapMode">lineWrapMode</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qtextedit.html#loadResource">loadResource</a></b> (<i>self</i>, int&#160;<i>type</i>, QUrl&#160;<i>name</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#mergeCurrentCharFormat">mergeCurrentCharFormat</a></b> (<i>self</i>, QTextCharFormat&#160;<i>modifier</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#mouseMoveEvent">mouseMoveEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#mouseReleaseEvent">mouseReleaseEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#moveCursor">moveCursor</a></b> (<i>self</i>, QTextCursor.MoveOperation&#160;<i>operation</i>, QTextCursor.MoveMode&#160;<i>mode</i>&#160;=&#160;QTextCursor.MoveAnchor)</li><li><div class="fn" />bool <b><a href="qtextedit.html#overwriteMode">overwriteMode</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#paste">paste</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#print">print</a></b> (<i>self</i>, QPrinter&#160;<i>printer</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#print">print_</a></b> (<i>self</i>, QPrinter&#160;<i>printer</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#redo">redo</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QResizeEvent)</li><li><div class="fn" /><b><a href="qtextedit.html#scrollContentsBy">scrollContentsBy</a></b> (<i>self</i>, int&#160;<i>dx</i>, int&#160;<i>dy</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#scrollToAnchor">scrollToAnchor</a></b> (<i>self</i>, QString&#160;<i>name</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#selectAll">selectAll</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setAcceptRichText">setAcceptRichText</a></b> (<i>self</i>, bool&#160;<i>accept</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setAlignment">setAlignment</a></b> (<i>self</i>, Qt.Alignment&#160;<i>a</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setAutoFormatting">setAutoFormatting</a></b> (<i>self</i>, AutoFormatting&#160;<i>features</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setCurrentCharFormat">setCurrentCharFormat</a></b> (<i>self</i>, QTextCharFormat&#160;<i>format</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setCurrentFont">setCurrentFont</a></b> (<i>self</i>, QFont&#160;<i>f</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setCursorWidth">setCursorWidth</a></b> (<i>self</i>, int&#160;<i>width</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setDocument">setDocument</a></b> (<i>self</i>, QTextDocument&#160;<i>document</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setDocumentTitle">setDocumentTitle</a></b> (<i>self</i>, QString&#160;<i>title</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setExtraSelections">setExtraSelections</a></b> (<i>self</i>, list-of-QTextEdit.ExtraSelection&#160;<i>selections</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setFontFamily">setFontFamily</a></b> (<i>self</i>, QString&#160;<i>fontFamily</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setFontItalic">setFontItalic</a></b> (<i>self</i>, bool&#160;<i>b</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setFontPointSize">setFontPointSize</a></b> (<i>self</i>, float&#160;<i>s</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setFontUnderline">setFontUnderline</a></b> (<i>self</i>, bool&#160;<i>b</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setFontWeight">setFontWeight</a></b> (<i>self</i>, int&#160;<i>w</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setHtml">setHtml</a></b> (<i>self</i>, QString&#160;<i>text</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setLineWrapColumnOrWidth">setLineWrapColumnOrWidth</a></b> (<i>self</i>, int&#160;<i>w</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setLineWrapMode">setLineWrapMode</a></b> (<i>self</i>, LineWrapMode&#160;<i>mode</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setOverwriteMode">setOverwriteMode</a></b> (<i>self</i>, bool&#160;<i>overwrite</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setPlainText">setPlainText</a></b> (<i>self</i>, QString&#160;<i>text</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setReadOnly">setReadOnly</a></b> (<i>self</i>, bool&#160;<i>ro</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setTabChangesFocus">setTabChangesFocus</a></b> (<i>self</i>, bool&#160;<i>b</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setTabStopWidth">setTabStopWidth</a></b> (<i>self</i>, int&#160;<i>width</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setText">setText</a></b> (<i>self</i>, QString&#160;<i>text</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setTextBackgroundColor">setTextBackgroundColor</a></b> (<i>self</i>, QColor&#160;<i>c</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setTextColor">setTextColor</a></b> (<i>self</i>, QColor&#160;<i>c</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setTextCursor">setTextCursor</a></b> (<i>self</i>, QTextCursor&#160;<i>cursor</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setTextInteractionFlags">setTextInteractionFlags</a></b> (<i>self</i>, Qt.TextInteractionFlags&#160;<i>flags</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setUndoRedoEnabled">setUndoRedoEnabled</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#setWordWrapMode">setWordWrapMode</a></b> (<i>self</i>, QTextOption.WrapMode&#160;<i>policy</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#showEvent">showEvent</a></b> (<i>self</i>, QShowEvent)</li><li><div class="fn" />bool <b><a href="qtextedit.html#tabChangesFocus">tabChangesFocus</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextedit.html#tabStopWidth">tabStopWidth</a></b> (<i>self</i>)</li><li><div class="fn" />QColor <b><a href="qtextedit.html#textBackgroundColor">textBackgroundColor</a></b> (<i>self</i>)</li><li><div class="fn" />QColor <b><a href="qtextedit.html#textColor">textColor</a></b> (<i>self</i>)</li><li><div class="fn" />QTextCursor <b><a href="qtextedit.html#textCursor">textCursor</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.TextInteractionFlags <b><a href="qtextedit.html#textInteractionFlags">textInteractionFlags</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#timerEvent">timerEvent</a></b> (<i>self</i>, QTimerEvent&#160;<i>e</i>)</li><li><div class="fn" />QString <b><a href="qtextedit.html#toHtml">toHtml</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qtextedit.html#toPlainText">toPlainText</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#undo">undo</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#wheelEvent">wheelEvent</a></b> (<i>self</i>, QWheelEvent&#160;<i>e</i>)</li><li><div class="fn" />QTextOption.WrapMode <b><a href="qtextedit.html#wordWrapMode">wordWrapMode</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextedit.html#zoomIn">zoomIn</a></b> (<i>self</i>, int&#160;<i>range</i>&#160;=&#160;1)</li><li><div class="fn" /><b><a href="qtextedit.html#zoomOut">zoomOut</a></b> (<i>self</i>, int&#160;<i>range</i>&#160;=&#160;1)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qtextedit.html#copyAvailable">copyAvailable</a></b> (bool)</li><li><div class="fn" />void <b><a href="qtextedit.html#currentCharFormatChanged">currentCharFormatChanged</a></b> (const QTextCharFormat&amp;)</li><li><div class="fn" />void <b><a href="qtextedit.html#cursorPositionChanged">cursorPositionChanged</a></b> ()</li><li><div class="fn" />void <b><a href="qtextedit.html#redoAvailable">redoAvailable</a></b> (bool)</li><li><div class="fn" />void <b><a href="qtextedit.html#selectionChanged">selectionChanged</a></b> ()</li><li><div class="fn" />void <b><a href="qtextedit.html#textChanged">textChanged</a></b> ()</li><li><div class="fn" />void <b><a href="qtextedit.html#undoAvailable">undoAvailable</a></b> (bool)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTextEdit class provides a widget that is used to edit and
display both plain and rich text.</p>
<a id="introduction-and-concepts" name="introduction-and-concepts" />
<h3>Introduction and Concepts</h3>
<p>QTextEdit is an advanced WYSIWYG viewer/editor supporting rich
text formatting using HTML-style tags. It is optimized to handle
large documents and to respond quickly to user input.</p>
<p>QTextEdit works on paragraphs and characters. A paragraph is a
formatted string which is word-wrapped to fit into the width of the
widget. By default when reading plain text, one newline signifies a
paragraph. A document consists of zero or more paragraphs. The
words in the paragraph are aligned in accordance with the
paragraph's alignment. Paragraphs are separated by hard line
breaks. Each character within a paragraph has its own attributes,
for example, font and color.</p>
<p>QTextEdit can display images, lists and tables. If the text is
too large to view within the text edit's viewport, scroll bars will
appear. The text edit can load both plain text and HTML files (a
subset of HTML 3.2 and 4).</p>
<p>If you just need to display a small piece of rich text use
<a href="qlabel.html">QLabel</a>.</p>
<p>The rich text support in Qt is designed to provide a fast,
portable and efficient way to add reasonable online help facilities
to applications, and to provide a basis for rich text editors. If
you find the HTML support insufficient for your needs you may
consider the use of <a href="qtwebkit.html">QtWebKit</a>, which
provides a full-featured web browser widget.</p>
<p>The shape of the mouse cursor on a QTextEdit is <a href="qt.html#CursorShape-enum">Qt.IBeamCursor</a> by default. It can
be changed through the <a href="qabstractscrollarea.html#viewport">viewport</a>()'s cursor
property.</p>
<a id="using-qtextedit-as-a-display-widget" name="using-qtextedit-as-a-display-widget" />
<h3>Using QTextEdit as a Display Widget</h3>
<p>QTextEdit can display a large HTML subset, including tables and
images.</p>
<p>The text is set or replaced using <a href="qtextedit.html#html-prop">setHtml</a>() which deletes any existing
text and replaces it with the text passed in the <a href="qtextedit.html#html-prop">setHtml</a>() call. If you call <a href="qtextedit.html#html-prop">setHtml</a>() with legacy HTML, and then
call <a href="qtextedit.html#html-prop">toHtml</a>(), the text that
is returned may have different markup, but will render the same.
The entire text can be deleted with <a href="qtextedit.html#clear">clear</a>().</p>
<p>Text itself can be inserted using the <a href="qtextcursor.html">QTextCursor</a> class or using the convenience
functions <a href="qtextedit.html#insertHtml">insertHtml</a>(),
<a href="qtextedit.html#insertPlainText">insertPlainText</a>(),
<a href="qtextedit.html#append">append</a>() or <a href="qtextedit.html#paste">paste</a>(). <a href="qtextcursor.html">QTextCursor</a> is also able to insert complex
objects like tables or lists into the document, and it deals with
creating selections and applying changes to selected text.</p>
<p>By default the text edit wraps words at whitespace to fit within
the text edit widget. The <a href="qtextedit.html#lineWrapMode-prop">setLineWrapMode</a>() function
is used to specify the kind of line wrap you want, or <a href="qtextedit.html#LineWrapMode-enum">NoWrap</a> if you don't want any
wrapping. Call <a href="qtextedit.html#lineWrapMode-prop">setLineWrapMode</a>() to set a
fixed pixel width <a href="qtextedit.html#LineWrapMode-enum">FixedPixelWidth</a>, or
character column (e.g. 80 column) <a href="qtextedit.html#LineWrapMode-enum">FixedColumnWidth</a> with the
pixels or columns specified with <a href="qtextedit.html#lineWrapColumnOrWidth-prop">setLineWrapColumnOrWidth</a>().
If you use word wrap to the widget's width <a href="qtextedit.html#LineWrapMode-enum">WidgetWidth</a>, you can specify
whether to break on whitespace or anywhere with <a href="qtextedit.html#wordWrapMode-prop">setWordWrapMode</a>().</p>
<p>The <a href="qtextedit.html#find">find</a>() function can be
used to find and select a given string within the text.</p>
<p>If you want to limit the total number of paragraphs in a
QTextEdit, as for example it is often useful in a log viewer, then
you can use <a href="qtextdocument.html">QTextDocument</a>'s
maximumBlockCount property for that.</p>
<a id="read-only-key-bindings" name="read-only-key-bindings" />
<h4>Read-only Key Bindings</h4>
<p>When QTextEdit is used read-only the key bindings are limited to
navigation, and text may only be selected with the mouse:</p>
<table class="generic">
<thead>
<tr class="qt-style">
<th>Keypresses</th>
<th>Action</th>
</tr>
</thead>
<tr class="odd" valign="top">
<td>Up</td>
<td>Moves one line up.</td>
</tr>
<tr class="even" valign="top">
<td>Down</td>
<td>Moves one line down.</td>
</tr>
<tr class="odd" valign="top">
<td>Left</td>
<td>Moves one character to the left.</td>
</tr>
<tr class="even" valign="top">
<td>Right</td>
<td>Moves one character to the right.</td>
</tr>
<tr class="odd" valign="top">
<td>PageUp</td>
<td>Moves one (viewport) page up.</td>
</tr>
<tr class="even" valign="top">
<td>PageDown</td>
<td>Moves one (viewport) page down.</td>
</tr>
<tr class="odd" valign="top">
<td>Home</td>
<td>Moves to the beginning of the text.</td>
</tr>
<tr class="even" valign="top">
<td>End</td>
<td>Moves to the end of the text.</td>
</tr>
<tr class="odd" valign="top">
<td>Alt+Wheel</td>
<td>Scrolls the page horizontally (the Wheel is the mouse
wheel).</td>
</tr>
<tr class="even" valign="top">
<td>Ctrl+Wheel</td>
<td>Zooms the text.</td>
</tr>
<tr class="odd" valign="top">
<td>Ctrl+A</td>
<td>Selects all text.</td>
</tr>
</table>
<p>The text edit may be able to provide some meta-information. For
example, the <a href="qtextedit.html#documentTitle-prop">documentTitle</a>() function
will return the text from within HTML <tt>&lt;title&gt;</tt>
tags.</p>
<a id="using-qtextedit-as-an-editor" name="using-qtextedit-as-an-editor" />
<h3>Using QTextEdit as an Editor</h3>
<p>All the information about using QTextEdit as a display widget
also applies here.</p>
<p>The current char format's attributes are set with <a href="qtextedit.html#setFontItalic">setFontItalic</a>(), <a href="qtextedit.html#setFontWeight">setFontWeight</a>(), <a href="qtextedit.html#setFontUnderline">setFontUnderline</a>(), <a href="qtextedit.html#setFontFamily">setFontFamily</a>(), <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>(), <a href="qtextedit.html#setTextColor">setTextColor</a>() and <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(). The current
paragraph's alignment is set with <a href="qtextedit.html#setAlignment">setAlignment</a>().</p>
<p>Selection of text is handled by the <a href="qtextcursor.html">QTextCursor</a> class, which provides
functionality for creating selections, retrieving the text contents
or deleting selections. You can retrieve the object that
corresponds with the user-visible cursor using the <a href="qtextedit.html#textCursor">textCursor</a>() method. If you want to
set a selection in QTextEdit just create one on a <a href="qtextcursor.html">QTextCursor</a> object and then make that cursor
the visible cursor using <a href="qtextedit.html#setTextCursor">setTextCursor</a>(). The selection
can be copied to the clipboard with <a href="qtextedit.html#copy">copy</a>(), or cut to the clipboard with
<a href="qtextedit.html#cut">cut</a>(). The entire text can be
selected using <a href="qtextedit.html#selectAll">selectAll</a>().</p>
<p>When the cursor is moved and the underlying formatting
attributes change, the <a href="qtextedit.html#currentCharFormatChanged">currentCharFormatChanged</a>()
signal is emitted to reflect the new attributes at the new cursor
position.</p>
<p>QTextEdit holds a <a href="qtextdocument.html">QTextDocument</a>
object which can be retrieved using the <a href="qtextedit.html#document">document</a>() method. You can also set
your own document object using <a href="qtextedit.html#setDocument">setDocument</a>(). <a href="qtextdocument.html">QTextDocument</a> emits a <a href="qtextedit.html#textChanged">textChanged</a>() signal if the text
changes and it also provides a <a class="compat" href="qtextedit-qt3.html#isModified">isModified</a>()
function which will return true if the text has been modified since
it was either loaded or since the last call to setModified with
false as argument. In addition it provides methods for undo and
redo.</p>
<a id="drag-and-drop" name="drag-and-drop" />
<h4>Drag and Drop</h4>
<p>QTextEdit also supports custom drag and drop behavior. By
default, QTextEdit will insert plain text, HTML and rich text when
the user drops data of these MIME types onto a document.
Reimplement <a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a>()
and <a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a>() to add
support for additional MIME types.</p>
<p>For example, to allow the user to drag and drop an image onto a
QTextEdit, you could the implement these functions in the following
way:</p>
<pre class="cpp">
 <span class="type">bool</span> TextEdit<span class="operator">.</span><a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a>( <span class="keyword">const</span> <span class="type"><a href="qmimedata.html">QMimeData</a></span> <span class="operator">*</span>source ) <span class="keyword">const</span>
 {
     <span class="keyword">if</span> (source<span class="operator">-</span><span class="operator">&gt;</span>hasImage())
         <span class="keyword">return</span> <span class="keyword">true</span>;
     <span class="keyword">else</span>
         <span class="keyword">return</span> <span class="type">QTextEdit</span><span class="operator">.</span>canInsertFromMimeData(source);
 }
</pre>
<p>We add support for image MIME types by returning true. For all
other MIME types, we use the default implementation.</p>
<pre class="cpp">
 <span class="type">void</span> TextEdit<span class="operator">.</span><a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a>( <span class="keyword">const</span> <span class="type"><a href="qmimedata.html">QMimeData</a></span> <span class="operator">*</span>source )
 {
     <span class="keyword">if</span> (source<span class="operator">-</span><span class="operator">&gt;</span>hasImage())
     {
         <span class="type"><a href="qimage.html">QImage</a></span> image <span class="operator">=</span> qvariant_cast<span class="operator">&lt;</span><span class="type"><a href="qimage.html">QImage</a></span><span class="operator">&gt;</span>(source<span class="operator">-</span><span class="operator">&gt;</span>imageData());
         <span class="type"><a href="qtextcursor.html">QTextCursor</a></span> cursor <span class="operator">=</span> <span class="keyword">this</span><span class="operator">-</span><span class="operator">&gt;</span>textCursor();
         <span class="type"><a href="qtextdocument.html">QTextDocument</a></span> <span class="operator">*</span>document <span class="operator">=</span> <span class="keyword">this</span><span class="operator">-</span><span class="operator">&gt;</span>document();
         document<span class="operator">-</span><span class="operator">&gt;</span>addResource(<span class="type"><a href="qtextdocument.html">QTextDocument</a></span><span class="operator">.</span>ImageResource<span class="operator">,</span> <span class="type"><a href="qurl.html">QUrl</a></span>(<span class="string">"image"</span>)<span class="operator">,</span> image);
         cursor<span class="operator">.</span>insertImage(<span class="string">"image"</span>);
     }
 }
</pre>
<p>We unpack the image from the <a href="qvariant.html">QVariant</a> held by the MIME source and insert it
into the document as a resource.</p>
<a id="editing-key-bindings" name="editing-key-bindings" />
<h4>Editing Key Bindings</h4>
<p>The list of key bindings which are implemented for editing:</p>
<table class="generic">
<thead>
<tr class="qt-style">
<th>Keypresses</th>
<th>Action</th>
</tr>
</thead>
<tr class="odd" valign="top">
<td>Backspace</td>
<td>Deletes the character to the left of the cursor.</td>
</tr>
<tr class="even" valign="top">
<td>Delete</td>
<td>Deletes the character to the right of the cursor.</td>
</tr>
<tr class="odd" valign="top">
<td>Ctrl+C</td>
<td>Copy the selected text to the clipboard.</td>
</tr>
<tr class="even" valign="top">
<td>Ctrl+Insert</td>
<td>Copy the selected text to the clipboard.</td>
</tr>
<tr class="odd" valign="top">
<td>Ctrl+K</td>
<td>Deletes to the end of the line.</td>
</tr>
<tr class="even" valign="top">
<td>Ctrl+V</td>
<td>Pastes the clipboard text into text edit.</td>
</tr>
<tr class="odd" valign="top">
<td>Shift+Insert</td>
<td>Pastes the clipboard text into text edit.</td>
</tr>
<tr class="even" valign="top">
<td>Ctrl+X</td>
<td>Deletes the selected text and copies it to the clipboard.</td>
</tr>
<tr class="odd" valign="top">
<td>Shift+Delete</td>
<td>Deletes the selected text and copies it to the clipboard.</td>
</tr>
<tr class="even" valign="top">
<td>Ctrl+Z</td>
<td>Undoes the last operation.</td>
</tr>
<tr class="odd" valign="top">
<td>Ctrl+Y</td>
<td>Redoes the last operation.</td>
</tr>
<tr class="even" valign="top">
<td>Left</td>
<td>Moves the cursor one character to the left.</td>
</tr>
<tr class="odd" valign="top">
<td>Ctrl+Left</td>
<td>Moves the cursor one word to the left.</td>
</tr>
<tr class="even" valign="top">
<td>Right</td>
<td>Moves the cursor one character to the right.</td>
</tr>
<tr class="odd" valign="top">
<td>Ctrl+Right</td>
<td>Moves the cursor one word to the right.</td>
</tr>
<tr class="even" valign="top">
<td>Up</td>
<td>Moves the cursor one line up.</td>
</tr>
<tr class="odd" valign="top">
<td>Down</td>
<td>Moves the cursor one line down.</td>
</tr>
<tr class="even" valign="top">
<td>PageUp</td>
<td>Moves the cursor one page up.</td>
</tr>
<tr class="odd" valign="top">
<td>PageDown</td>
<td>Moves the cursor one page down.</td>
</tr>
<tr class="even" valign="top">
<td>Home</td>
<td>Moves the cursor to the beginning of the line.</td>
</tr>
<tr class="odd" valign="top">
<td>Ctrl+Home</td>
<td>Moves the cursor to the beginning of the text.</td>
</tr>
<tr class="even" valign="top">
<td>End</td>
<td>Moves the cursor to the end of the line.</td>
</tr>
<tr class="odd" valign="top">
<td>Ctrl+End</td>
<td>Moves the cursor to the end of the text.</td>
</tr>
<tr class="even" valign="top">
<td>Alt+Wheel</td>
<td>Scrolls the page horizontally (the Wheel is the mouse
wheel).</td>
</tr>
</table>
<p>To select (mark) text hold down the Shift key whilst pressing
one of the movement keystrokes, for example, <i>Shift+Right</i>
will select the character to the right, and <i>Shift+Ctrl+Right</i>
will select the word to the right, etc.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="AutoFormattingFlag-enum" />QTextEdit.AutoFormattingFlag</h3><table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QTextEdit.AutoNone</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Don't do any automatic formatting.</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextEdit.AutoBulletList</tt></td>
<td class="topAlign"><tt>0x00000001</tt></td>
<td class="topAlign">Automatically create bullet lists (e.g. when
the user enters an asterisk ('*') in the left most column, or
presses Enter in an existing list item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextEdit.AutoAll</tt></td>
<td class="topAlign"><tt>0xffffffff</tt></td>
<td class="topAlign">Apply all automatic formatting. Currently only
automatic bullet lists are supported.</td>
</tr>
</table>
<p>The AutoFormatting type is a typedef for <a href="qflags.html">QFlags</a>&lt;AutoFormattingFlag&gt;. It stores an OR
combination of AutoFormattingFlag values.</p>


<h3 class="fn"><a name="LineWrapMode-enum" />QTextEdit.LineWrapMode</h3><table class="valuelist">
<tr>
<th class="tblConst">Constant</th>
<th class="tblVal">Value</th>
</tr>
<tr>
<td class="topAlign"><tt>QTextEdit.NoWrap</tt></td>
<td class="topAlign"><tt>0</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QTextEdit.WidgetWidth</tt></td>
<td class="topAlign"><tt>1</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QTextEdit.FixedPixelWidth</tt></td>
<td class="topAlign"><tt>2</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QTextEdit.FixedColumnWidth</tt></td>
<td class="topAlign"><tt>3</tt></td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTextEdit" />QTextEdit.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an empty <a href="qtextedit.html">QTextEdit</a> with
parent <i>parent</i>.</p>


<h3 class="fn"><a name="QTextEdit-2" />QTextEdit.__init__ (<i>self</i>, QString&#160;<i>text</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qtextedit.html">QTextEdit</a> with parent
<i>parent</i>. The text edit will display the text <i>text</i>. The
text is interpreted as html.</p>


<h3 class="fn"><a name="acceptRichText" />bool QTextEdit.acceptRichText (<i>self</i>)</h3><h3 class="fn"><a name="alignment" /><a href="qt-alignment.html">Qt.Alignment</a> QTextEdit.alignment (<i>self</i>)</h3><p>Returns the alignment of the current paragraph.</p>
<p><b>See also</b> <a href="qtextedit.html#setAlignment">setAlignment</a>().</p>


<h3 class="fn"><a name="anchorAt" />QString QTextEdit.anchorAt (<i>self</i>, <a href="qpoint.html">QPoint</a>&#160;<i>pos</i>)</h3><p>Returns the reference of the anchor at position <i>pos</i>, or
an empty string if no anchor exists at that point.</p>


<h3 class="fn"><a name="append" />QTextEdit.append (<i>self</i>, QString&#160;<i>text</i>)</h3><p>Appends a new paragraph with <i>text</i> to the end of the text
edit.</p>
<p><b>Note:</b> The new paragraph appended will have the same
character format and block format as the current paragraph,
determined by the position of the cursor.</p>
<p><b>See also</b> <a href="qtextedit.html#currentCharFormat">currentCharFormat</a>() and
<a href="qtextcursor.html#blockFormat">QTextCursor.blockFormat</a>().</p>


<h3 class="fn"><a name="autoFormatting" /><a href="qtextedit-autoformatting.html">AutoFormatting</a> QTextEdit.autoFormatting (<i>self</i>)</h3><h3 class="fn"><a name="canInsertFromMimeData" />bool QTextEdit.canInsertFromMimeData (<i>self</i>, <a href="qmimedata.html">QMimeData</a>&#160;<i>source</i>)</h3><p>This function returns true if the contents of the MIME data
object, specified by <i>source</i>, can be decoded and inserted
into the document. It is called for example when during a drag
operation the mouse enters this widget and it is necessary to
determine whether it is possible to accept the drag and drop
operation.</p>
<p>Reimplement this function to enable drag and drop support for
additional MIME types.</p>


<h3 class="fn"><a name="canPaste" />bool QTextEdit.canPaste (<i>self</i>)</h3><p>Returns whether text can be pasted from the clipboard into the
textedit.</p>
<p>This function was introduced in Qt 4.2.</p>


<h3 class="fn"><a name="changeEvent" />QTextEdit.changeEvent (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget.changeEvent</a>().</p>


<h3 class="fn"><a name="clear" />QTextEdit.clear (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void clear()</tt>.</p><p>Deletes all the text in the text edit.</p>
<p>Note that the undo/redo history is cleared by this function.</p>
<p><b>See also</b> <a href="qtextedit.html#cut">cut</a>(), <a href="qtextedit.html#plainText-prop">setPlainText</a>(), and <a href="qtextedit.html#html-prop">setHtml</a>().</p>


<h3 class="fn"><a name="contextMenuEvent" />QTextEdit.contextMenuEvent (<i>self</i>, <a href="qcontextmenuevent.html">QContextMenuEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#contextMenuEvent">QWidget.contextMenuEvent</a>().</p>
<p>Shows the standard context menu created with <a href="qtextedit.html#createStandardContextMenu">createStandardContextMenu</a>().</p>
<p>If you do not want the text edit to have a context menu, you can
set its <a href="qwidget.html#contextMenuPolicy-prop">contextMenuPolicy</a> to
<a href="qt.html#ContextMenuPolicy-enum">Qt.NoContextMenu</a>. If
you want to customize the context menu, reimplement this function.
If you want to extend the standard context menu, reimplement this
function, call <a href="qtextedit.html#createStandardContextMenu">createStandardContextMenu</a>()
and extend the menu returned.</p>
<p>Information about the event is passed in the <i>event</i>
object.</p>
<pre class="cpp">
 <span class="type">void</span> MyTextEdit<span class="operator">.</span>contextMenuEvent(<span class="type"><a href="qcontextmenuevent.html">QContextMenuEvent</a></span> <span class="operator">*</span>event)
 {
     <span class="type"><a href="qmenu.html">QMenu</a></span> <span class="operator">*</span>menu <span class="operator">=</span> createStandardContextMenu();
     menu<span class="operator">-</span><span class="operator">&gt;</span>addAction(tr(<span class="string">"My Menu Item"</span>));
     <span class="comment">//...</span>
     menu<span class="operator">-</span><span class="operator">&gt;</span>exec(event<span class="operator">-</span><span class="operator">&gt;</span>globalPos());
     <span class="keyword">delete</span> menu;
 }
</pre>


<h3 class="fn"><a name="copy" />QTextEdit.copy (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void copy()</tt>.</p><p>Copies any selected text to the clipboard.</p>
<p><b>See also</b> <a href="qtextedit.html#copyAvailable">copyAvailable</a>().</p>


<h3 class="fn"><a name="createMimeDataFromSelection" /><a href="qmimedata.html">QMimeData</a> QTextEdit.createMimeDataFromSelection (<i>self</i>)</h3><p>This function returns a new MIME data object to represent the
contents of the text edit's current selection. It is called when
the selection needs to be encapsulated into a new <a href="qmimedata.html">QMimeData</a> object; for example, when a drag and
drop operation is started, or when data is copyied to the
clipboard.</p>
<p>If you reimplement this function, note that the ownership of the
returned <a href="qmimedata.html">QMimeData</a> object is passed to
the caller. The selection can be retrieved by using the <a href="qtextedit.html#textCursor">textCursor</a>() function.</p>


<h3 class="fn"><a name="createStandardContextMenu" /><a href="qmenu.html">QMenu</a> QTextEdit.createStandardContextMenu (<i>self</i>)</h3><p>This function creates the standard context menu which is shown
when the user clicks on the text edit with the right mouse button.
It is called from the default <a href="qtextedit.html#contextMenuEvent">contextMenuEvent</a>() handler.
The popup menu's ownership is transferred to the caller.</p>
<p>We recommend that you use the createStandardContextMenu(<a href="qpoint.html">QPoint</a>) version instead which will enable the
actions that are sensitive to where the user clicked.</p>


<h3 class="fn"><a name="createStandardContextMenu-2" /><a href="qmenu.html">QMenu</a> QTextEdit.createStandardContextMenu (<i>self</i>, <a href="qpoint.html">QPoint</a>&#160;<i>position</i>)</h3><p>This function creates the standard context menu which is shown
when the user clicks on the text edit with the right mouse button.
It is called from the default <a href="qtextedit.html#contextMenuEvent">contextMenuEvent</a>() handler
and it takes the <i>position</i> of where the mouse click was. This
can enable actions that are sensitive to the position where the
user clicked. The popup menu's ownership is transferred to the
caller.</p>
<p>This function was introduced in Qt 4.4.</p>


<h3 class="fn"><a name="currentCharFormat" /><a href="qtextcharformat.html">QTextCharFormat</a> QTextEdit.currentCharFormat (<i>self</i>)</h3><p>Returns the char format that is used when inserting new
text.</p>
<p><b>See also</b> <a href="qtextedit.html#setCurrentCharFormat">setCurrentCharFormat</a>().</p>


<h3 class="fn"><a name="currentFont" /><a href="qfont.html">QFont</a> QTextEdit.currentFont (<i>self</i>)</h3><p>Returns the font of the current format.</p>
<p><b>See also</b> <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), <a href="qtextedit.html#setFontFamily">setFontFamily</a>(), and <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>().</p>


<h3 class="fn"><a name="cursorForPosition" /><a href="qtextcursor.html">QTextCursor</a> QTextEdit.cursorForPosition (<i>self</i>, <a href="qpoint.html">QPoint</a>&#160;<i>pos</i>)</h3><p>returns a <a href="qtextcursor.html">QTextCursor</a> at position
<i>pos</i> (in viewport coordinates).</p>


<h3 class="fn"><a name="cursorRect" /><a href="qrect.html">QRect</a> QTextEdit.cursorRect (<i>self</i>, <a href="qtextcursor.html">QTextCursor</a>&#160;<i>cursor</i>)</h3><p>returns a rectangle (in viewport coordinates) that includes the
<i>cursor</i>.</p>


<h3 class="fn"><a name="cursorRect-2" /><a href="qrect.html">QRect</a> QTextEdit.cursorRect (<i>self</i>)</h3><p>returns a rectangle (in viewport coordinates) that includes the
cursor of the text edit.</p>


<h3 class="fn"><a name="cursorWidth" />int QTextEdit.cursorWidth (<i>self</i>)</h3><h3 class="fn"><a name="cut" />QTextEdit.cut (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void cut()</tt>.</p><p>Copies the selected text to the clipboard and deletes it from
the text edit.</p>
<p>If there is no selected text nothing happens.</p>
<p><b>See also</b> <a href="qtextedit.html#copy">copy</a>() and
<a href="qtextedit.html#paste">paste</a>().</p>


<h3 class="fn"><a name="document" /><a href="qtextdocument.html">QTextDocument</a> QTextEdit.document (<i>self</i>)</h3><p>Returns a pointer to the underlying document.</p>
<p><b>See also</b> <a href="qtextedit.html#setDocument">setDocument</a>().</p>


<h3 class="fn"><a name="documentTitle" />QString QTextEdit.documentTitle (<i>self</i>)</h3><h3 class="fn"><a name="dragEnterEvent" />QTextEdit.dragEnterEvent (<i>self</i>, <a href="qdragenterevent.html">QDragEnterEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#dragEnterEvent">QWidget.dragEnterEvent</a>().</p>


<h3 class="fn"><a name="dragLeaveEvent" />QTextEdit.dragLeaveEvent (<i>self</i>, <a href="qdragleaveevent.html">QDragLeaveEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#dragLeaveEvent">QWidget.dragLeaveEvent</a>().</p>


<h3 class="fn"><a name="dragMoveEvent" />QTextEdit.dragMoveEvent (<i>self</i>, <a href="qdragmoveevent.html">QDragMoveEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#dragMoveEvent">QWidget.dragMoveEvent</a>().</p>


<h3 class="fn"><a name="dropEvent" />QTextEdit.dropEvent (<i>self</i>, <a href="qdropevent.html">QDropEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#dropEvent">QWidget.dropEvent</a>().</p>


<h3 class="fn"><a name="ensureCursorVisible" />QTextEdit.ensureCursorVisible (<i>self</i>)</h3><p>Ensures that the cursor is visible by scrolling the text edit if
necessary.</p>


<h3 class="fn"><a name="event" />bool QTextEdit.event (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>e</i>)</h3><h3 class="fn"><a name="extraSelections" />list-of-QTextEdit.ExtraSelection QTextEdit.extraSelections (<i>self</i>)</h3><p>Returns previously set extra selections.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qtextedit.html#setExtraSelections">setExtraSelections</a>().</p>


<h3 class="fn"><a name="find" />bool QTextEdit.find (<i>self</i>, QString&#160;<i>exp</i>, <a href="qtextdocument-findflags.html">QTextDocument.FindFlags</a>&#160;<i>options</i>&#160;=&#160;0)</h3><p>Finds the next occurrence of the string, <i>exp</i>, using the
given <i>options</i>. Returns true if <i>exp</i> was found and
changes the cursor to select the match; otherwise returns
false.</p>


<h3 class="fn"><a name="focusInEvent" />QTextEdit.focusInEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#focusInEvent">QWidget.focusInEvent</a>().</p>


<h3 class="fn"><a name="focusNextPrevChild" />bool QTextEdit.focusNextPrevChild (<i>self</i>, bool&#160;<i>next</i>)</h3><p>Reimplemented from <a href="qwidget.html#focusNextPrevChild">QWidget.focusNextPrevChild</a>().</p>


<h3 class="fn"><a name="focusOutEvent" />QTextEdit.focusOutEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#focusOutEvent">QWidget.focusOutEvent</a>().</p>


<h3 class="fn"><a name="fontFamily" />QString QTextEdit.fontFamily (<i>self</i>)</h3><p>Returns the font family of the current format.</p>
<p><b>See also</b> <a href="qtextedit.html#setFontFamily">setFontFamily</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>().</p>


<h3 class="fn"><a name="fontItalic" />bool QTextEdit.fontItalic (<i>self</i>)</h3><p>Returns true if the font of the current format is italic;
otherwise returns false.</p>
<p><b>See also</b> <a href="qtextedit.html#setFontItalic">setFontItalic</a>().</p>


<h3 class="fn"><a name="fontPointSize" />float QTextEdit.fontPointSize (<i>self</i>)</h3><p>Returns the point size of the font of the current format.</p>
<p><b>See also</b> <a href="qtextedit.html#setFontFamily">setFontFamily</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>().</p>


<h3 class="fn"><a name="fontUnderline" />bool QTextEdit.fontUnderline (<i>self</i>)</h3><p>Returns true if the font of the current format is underlined;
otherwise returns false.</p>
<p><b>See also</b> <a href="qtextedit.html#setFontUnderline">setFontUnderline</a>().</p>


<h3 class="fn"><a name="fontWeight" />int QTextEdit.fontWeight (<i>self</i>)</h3><p>Returns the font weight of the current format.</p>
<p><b>See also</b> <a href="qtextedit.html#setFontWeight">setFontWeight</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>(), and
<a href="qfont.html#Weight-enum">QFont.Weight</a>.</p>


<h3 class="fn"><a name="inputMethodEvent" />QTextEdit.inputMethodEvent (<i>self</i>, <a href="qinputmethodevent.html">QInputMethodEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#inputMethodEvent">QWidget.inputMethodEvent</a>().</p>


<h3 class="fn"><a name="inputMethodQuery" />QVariant QTextEdit.inputMethodQuery (<i>self</i>, <a href="qt.html#InputMethodQuery-enum">Qt.InputMethodQuery</a>&#160;<i>property</i>)</h3><p>Reimplemented from <a href="qwidget.html#inputMethodQuery">QWidget.inputMethodQuery</a>().</p>


<h3 class="fn"><a name="insertFromMimeData" />QTextEdit.insertFromMimeData (<i>self</i>, <a href="qmimedata.html">QMimeData</a>&#160;<i>source</i>)</h3><p>This function inserts the contents of the MIME data object,
specified by <i>source</i>, into the text edit at the current
cursor position. It is called whenever text is inserted as the
result of a clipboard paste operation, or when the text edit
accepts data from a drag and drop operation.</p>
<p>Reimplement this function to enable drag and drop support for
additional MIME types.</p>


<h3 class="fn"><a name="insertHtml" />QTextEdit.insertHtml (<i>self</i>, QString&#160;<i>text</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void insertHtml(const QString&amp;)</tt>.</p><p>Convenience slot that inserts <i>text</i> which is assumed to be
of html formatting at the current cursor position.</p>
<p>It is equivalent to:</p>
<pre class="cpp">
 edit<span class="operator">-</span><span class="operator">&gt;</span><a href="qtextedit.html#textCursor">textCursor</a>()<span class="operator">.</span>insertHtml(fragment);
</pre>
<p><b>Note:</b> When using this function with a style sheet, the
style sheet will only apply to the current block in the document.
In order to apply a style sheet throughout a document, use <a href="qtextdocument.html#defaultStyleSheet-prop">QTextDocument.setDefaultStyleSheet</a>()
instead.</p>


<h3 class="fn"><a name="insertPlainText" />QTextEdit.insertPlainText (<i>self</i>, QString&#160;<i>text</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void insertPlainText(const QString&amp;)</tt>.</p><p>Convenience slot that inserts <i>text</i> at the current cursor
position.</p>
<p>It is equivalent to</p>
<pre class="cpp">
 edit<span class="operator">-</span><span class="operator">&gt;</span><a href="qtextedit.html#textCursor">textCursor</a>()<span class="operator">.</span>insertText(text);
</pre>


<h3 class="fn"><a name="isReadOnly" />bool QTextEdit.isReadOnly (<i>self</i>)</h3><h3 class="fn"><a name="isUndoRedoEnabled" />bool QTextEdit.isUndoRedoEnabled (<i>self</i>)</h3><h3 class="fn"><a name="keyPressEvent" />QTextEdit.keyPressEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget.keyPressEvent</a>().</p>


<h3 class="fn"><a name="keyReleaseEvent" />QTextEdit.keyReleaseEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#keyReleaseEvent">QWidget.keyReleaseEvent</a>().</p>


<h3 class="fn"><a name="lineWrapColumnOrWidth" />int QTextEdit.lineWrapColumnOrWidth (<i>self</i>)</h3><h3 class="fn"><a name="lineWrapMode" /><a href="qtextedit.html#LineWrapMode-enum">LineWrapMode</a> QTextEdit.lineWrapMode (<i>self</i>)</h3><h3 class="fn"><a name="loadResource" />QVariant QTextEdit.loadResource (<i>self</i>, int&#160;<i>type</i>, <a href="qurl.html">QUrl</a>&#160;<i>name</i>)</h3><p>Loads the resource specified by the given <i>type</i> and
<i>name</i>.</p>
<p>This function is an extension of <a href="qtextdocument.html#loadResource">QTextDocument.loadResource</a>().</p>
<p><b>See also</b> <a href="qtextdocument.html#loadResource">QTextDocument.loadResource</a>().</p>


<h3 class="fn"><a name="mergeCurrentCharFormat" />QTextEdit.mergeCurrentCharFormat (<i>self</i>, <a href="qtextcharformat.html">QTextCharFormat</a>&#160;<i>modifier</i>)</h3><p>Merges the properties specified in <i>modifier</i> into the
current character format by calling QTextCursor.mergeCharFormat on
the editor's cursor. If the editor has a selection then the
properties of <i>modifier</i> are directly applied to the
selection.</p>
<p><b>See also</b> <a href="qtextcursor.html#mergeCharFormat">QTextCursor.mergeCharFormat</a>().</p>


<h3 class="fn"><a name="mouseDoubleClickEvent" />QTextEdit.mouseDoubleClickEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#mouseDoubleClickEvent">QWidget.mouseDoubleClickEvent</a>().</p>


<h3 class="fn"><a name="mouseMoveEvent" />QTextEdit.mouseMoveEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget.mouseMoveEvent</a>().</p>


<h3 class="fn"><a name="mousePressEvent" />QTextEdit.mousePressEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget.mousePressEvent</a>().</p>


<h3 class="fn"><a name="mouseReleaseEvent" />QTextEdit.mouseReleaseEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget.mouseReleaseEvent</a>().</p>


<h3 class="fn"><a name="moveCursor" />QTextEdit.moveCursor (<i>self</i>, <a href="qtextcursor.html#MoveOperation-enum">QTextCursor.MoveOperation</a>&#160;<i>operation</i>, <a href="qtextcursor.html#MoveMode-enum">QTextCursor.MoveMode</a>&#160;<i>mode</i>&#160;=&#160;QTextCursor.MoveAnchor)</h3><p>Moves the cursor by performing the given <i>operation</i>.</p>
<p>If <i>mode</i> is <a href="qtextcursor.html#MoveMode-enum">QTextCursor.KeepAnchor</a>, the
cursor selects the text it moves over. This is the same effect that
the user achieves when they hold down the Shift key and move the
cursor with the cursor keys.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qtextcursor.html#movePosition">QTextCursor.movePosition</a>().</p>


<h3 class="fn"><a name="overwriteMode" />bool QTextEdit.overwriteMode (<i>self</i>)</h3><h3 class="fn"><a name="paintEvent" />QTextEdit.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p>
<p>This event handler can be reimplemented in a subclass to receive
paint events passed in <i>event</i>. It is usually unnecessary to
reimplement this function in a subclass of <a href="qtextedit.html">QTextEdit</a>.</p>
<p><b>Warning:</b> The underlying text document must not be
modified from within a reimplementation of this function.</p>


<h3 class="fn"><a name="paste" />QTextEdit.paste (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void paste()</tt>.</p><p>Pastes the text from the clipboard into the text edit at the
current cursor position.</p>
<p>If there is no text in the clipboard nothing happens.</p>
<p>To change the behavior of this function, i.e. to modify what
<a href="qtextedit.html">QTextEdit</a> can paste and how it is
being pasted, reimplement the virtual <a href="qtextedit.html#canInsertFromMimeData">canInsertFromMimeData</a>()
and <a href="qtextedit.html#insertFromMimeData">insertFromMimeData</a>()
functions.</p>
<p><b>See also</b> <a href="qtextedit.html#cut">cut</a>() and
<a href="qtextedit.html#copy">copy</a>().</p>


<h3 class="fn"><a name="print" />QTextEdit.print (<i>self</i>, <a href="qprinter.html">QPrinter</a>&#160;<i>printer</i>)</h3><p>Convenience function to print the text edit's document to the
given <i>printer</i>. This is equivalent to calling the print
method on the document directly except that this function also
supports <a href="qprinter.html#PrintRange-enum">QPrinter.Selection</a> as print
range.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qtextdocument.html#print">QTextDocument.print</a>().</p>


<h3 class="fn"><a name="print" />QTextEdit.print_ (<i>self</i>, <a href="qprinter.html">QPrinter</a>&#160;<i>printer</i>)</h3><p>Convenience function to print the text edit's document to the
given <i>printer</i>. This is equivalent to calling the print
method on the document directly except that this function also
supports <a href="qprinter.html#PrintRange-enum">QPrinter.Selection</a> as print
range.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qtextdocument.html#print">QTextDocument.print</a>().</p>


<h3 class="fn"><a name="redo" />QTextEdit.redo (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void redo()</tt>.</p><p>Redoes the last operation.</p>
<p>If there is no operation to redo, i.e. there is no redo step in
the undo/redo history, nothing happens.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qtextedit.html#undo">undo</a>().</p>


<h3 class="fn"><a name="resizeEvent" />QTextEdit.resizeEvent (<i>self</i>, <a href="qresizeevent.html">QResizeEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget.resizeEvent</a>().</p>


<h3 class="fn"><a name="scrollContentsBy" />QTextEdit.scrollContentsBy (<i>self</i>, int&#160;<i>dx</i>, int&#160;<i>dy</i>)</h3><p>Reimplemented from <a href="qabstractscrollarea.html#scrollContentsBy">QAbstractScrollArea.scrollContentsBy</a>().</p>


<h3 class="fn"><a name="scrollToAnchor" />QTextEdit.scrollToAnchor (<i>self</i>, QString&#160;<i>name</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void scrollToAnchor(const QString&amp;)</tt>.</p><p>Scrolls the text edit so that the anchor with the given
<i>name</i> is visible; does nothing if the <i>name</i> is empty,
or is already visible, or isn't found.</p>


<h3 class="fn"><a name="selectAll" />QTextEdit.selectAll (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void selectAll()</tt>.</p><p>Selects all text.</p>
<p><b>See also</b> <a href="qtextedit.html#copy">copy</a>(),
<a href="qtextedit.html#cut">cut</a>(), and <a href="qtextedit.html#textCursor">textCursor</a>().</p>


<h3 class="fn"><a name="setAcceptRichText" />QTextEdit.setAcceptRichText (<i>self</i>, bool&#160;<i>accept</i>)</h3><h3 class="fn"><a name="setAlignment" />QTextEdit.setAlignment (<i>self</i>, <a href="qt-alignment.html">Qt.Alignment</a>&#160;<i>a</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setAlignment(Qt::Alignment)</tt>.</p><p>Sets the alignment of the current paragraph to <i>a</i>. Valid
alignments are <a href="qt.html#AlignmentFlag-enum">Qt.AlignLeft</a>, <a href="qt.html#AlignmentFlag-enum">Qt.AlignRight</a>, <a href="qt.html#AlignmentFlag-enum">Qt.AlignJustify</a> and <a href="qt.html#AlignmentFlag-enum">Qt.AlignCenter</a> (which centers
horizontally).</p>
<p><b>See also</b> <a href="qtextedit.html#alignment">alignment</a>().</p>


<h3 class="fn"><a name="setAutoFormatting" />QTextEdit.setAutoFormatting (<i>self</i>, <a href="qtextedit-autoformatting.html">AutoFormatting</a>&#160;<i>features</i>)</h3><h3 class="fn"><a name="setCurrentCharFormat" />QTextEdit.setCurrentCharFormat (<i>self</i>, <a href="qtextcharformat.html">QTextCharFormat</a>&#160;<i>format</i>)</h3><p>Sets the char format that is be used when inserting new text to
<i>format</i> by calling <a href="qtextcursor.html#setCharFormat">QTextCursor.setCharFormat</a>()
on the editor's cursor. If the editor has a selection then the char
format is directly applied to the selection.</p>
<p><b>See also</b> <a href="qtextedit.html#currentCharFormat">currentCharFormat</a>().</p>


<h3 class="fn"><a name="setCurrentFont" />QTextEdit.setCurrentFont (<i>self</i>, <a href="qfont.html">QFont</a>&#160;<i>f</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentFont(const QFont&amp;)</tt>.</p><p>Sets the font of the current format to <i>f</i>.</p>
<p><b>See also</b> <a href="qtextedit.html#currentFont">currentFont</a>(), <a href="qtextedit.html#setFontPointSize">setFontPointSize</a>(), and
<a href="qtextedit.html#setFontFamily">setFontFamily</a>().</p>


<h3 class="fn"><a name="setCursorWidth" />QTextEdit.setCursorWidth (<i>self</i>, int&#160;<i>width</i>)</h3><h3 class="fn"><a name="setDocument" />QTextEdit.setDocument (<i>self</i>, <a href="qtextdocument.html">QTextDocument</a>&#160;<i>document</i>)</h3><p>Makes <i>document</i> the new document of the text editor.</p>
<p><b>Note:</b> The editor <i>does not take ownership of the
document</i> unless it is the document's parent object. The parent
object of the provided document remains the owner of the
object.</p>
<p>The editor does not delete the current document, even if it is a
child of the editor.</p>
<p><b>See also</b> <a href="qtextedit.html#document">document</a>().</p>


<h3 class="fn"><a name="setDocumentTitle" />QTextEdit.setDocumentTitle (<i>self</i>, QString&#160;<i>title</i>)</h3><h3 class="fn"><a name="setExtraSelections" />QTextEdit.setExtraSelections (<i>self</i>, list-of-QTextEdit.ExtraSelection&#160;<i>selections</i>)</h3><p>This function allows temporarily marking certain regions in the
document with a given color, specified as <i>selections</i>. This
can be useful for example in a programming editor to mark a whole
line of text with a given background color to indicate the
existence of a breakpoint.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qtextedit-extraselection.html">QTextEdit.ExtraSelection</a> and
<a href="qtextedit.html#extraSelections">extraSelections</a>().</p>


<h3 class="fn"><a name="setFontFamily" />QTextEdit.setFontFamily (<i>self</i>, QString&#160;<i>fontFamily</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setFontFamily(const QString&amp;)</tt>.</p><p>Sets the font family of the current format to
<i>fontFamily</i>.</p>
<p><b>See also</b> <a href="qtextedit.html#fontFamily">fontFamily</a>() and <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>().</p>


<h3 class="fn"><a name="setFontItalic" />QTextEdit.setFontItalic (<i>self</i>, bool&#160;<i>b</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setFontItalic(bool)</tt>.</p><p>If <i>italic</i> is true, sets the current format to italic;
otherwise sets the current format to non-italic.</p>
<p><b>See also</b> <a href="qtextedit.html#fontItalic">fontItalic</a>().</p>


<h3 class="fn"><a name="setFontPointSize" />QTextEdit.setFontPointSize (<i>self</i>, float&#160;<i>s</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setFontPointSize(qreal)</tt>.</p><p>Sets the point size of the current format to <i>s</i>.</p>
<p>Note that if <i>s</i> is zero or negative, the behavior of this
function is not defined.</p>
<p><b>See also</b> <a href="qtextedit.html#fontPointSize">fontPointSize</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontFamily">setFontFamily</a>().</p>


<h3 class="fn"><a name="setFontUnderline" />QTextEdit.setFontUnderline (<i>self</i>, bool&#160;<i>b</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setFontUnderline(bool)</tt>.</p><p>If <i>underline</i> is true, sets the current format to
underline; otherwise sets the current format to non-underline.</p>
<p><b>See also</b> <a href="qtextedit.html#fontUnderline">fontUnderline</a>().</p>


<h3 class="fn"><a name="setFontWeight" />QTextEdit.setFontWeight (<i>self</i>, int&#160;<i>w</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setFontWeight(int)</tt>.</p><p>Sets the font weight of the current format to the given
<i>weight</i>, where the value used is in the range defined by the
<a href="qfont.html#Weight-enum">QFont.Weight</a> enum.</p>
<p><b>See also</b> <a href="qtextedit.html#fontWeight">fontWeight</a>(), <a href="qtextedit.html#setCurrentFont">setCurrentFont</a>(), and <a href="qtextedit.html#setFontFamily">setFontFamily</a>().</p>


<h3 class="fn"><a name="setHtml" />QTextEdit.setHtml (<i>self</i>, QString&#160;<i>text</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setHtml(const QString&amp;)</tt>.</p><h3 class="fn"><a name="setLineWrapColumnOrWidth" />QTextEdit.setLineWrapColumnOrWidth (<i>self</i>, int&#160;<i>w</i>)</h3><h3 class="fn"><a name="setLineWrapMode" />QTextEdit.setLineWrapMode (<i>self</i>, <a href="qtextedit.html#LineWrapMode-enum">LineWrapMode</a>&#160;<i>mode</i>)</h3><h3 class="fn"><a name="setOverwriteMode" />QTextEdit.setOverwriteMode (<i>self</i>, bool&#160;<i>overwrite</i>)</h3><h3 class="fn"><a name="setPlainText" />QTextEdit.setPlainText (<i>self</i>, QString&#160;<i>text</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setPlainText(const QString&amp;)</tt>.</p><h3 class="fn"><a name="setReadOnly" />QTextEdit.setReadOnly (<i>self</i>, bool&#160;<i>ro</i>)</h3><h3 class="fn"><a name="setTabChangesFocus" />QTextEdit.setTabChangesFocus (<i>self</i>, bool&#160;<i>b</i>)</h3><h3 class="fn"><a name="setTabStopWidth" />QTextEdit.setTabStopWidth (<i>self</i>, int&#160;<i>width</i>)</h3><h3 class="fn"><a name="setText" />QTextEdit.setText (<i>self</i>, QString&#160;<i>text</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setText(const QString&amp;)</tt>.</p><p>Sets the text edit's <i>text</i>. The text can be plain text or
HTML and the text edit will try to guess the right format.</p>
<p>Use <a href="qtextedit.html#html-prop">setHtml</a>() or <a href="qtextedit.html#plainText-prop">setPlainText</a>() directly to
avoid text edit's guessing.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a class="compat" href="qtextedit-qt3.html#text">text</a>(), <a href="qtextedit.html#plainText-prop">toPlainText</a>(), and <a href="qtextedit.html#html-prop">toHtml</a>().</p>


<h3 class="fn"><a name="setTextBackgroundColor" />QTextEdit.setTextBackgroundColor (<i>self</i>, <a href="qcolor.html">QColor</a>&#160;<i>c</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setTextBackgroundColor(const QColor&amp;)</tt>.</p><p>Sets the text background color of the current format to
<i>c</i>.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qtextedit.html#textBackgroundColor">textBackgroundColor</a>().</p>


<h3 class="fn"><a name="setTextColor" />QTextEdit.setTextColor (<i>self</i>, <a href="qcolor.html">QColor</a>&#160;<i>c</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setTextColor(const QColor&amp;)</tt>.</p><p>Sets the text color of the current format to <i>c</i>.</p>
<p><b>See also</b> <a href="qtextedit.html#textColor">textColor</a>().</p>


<h3 class="fn"><a name="setTextCursor" />QTextEdit.setTextCursor (<i>self</i>, <a href="qtextcursor.html">QTextCursor</a>&#160;<i>cursor</i>)</h3><p>Sets the visible <i>cursor</i>.</p>
<p><b>See also</b> <a href="qtextedit.html#textCursor">textCursor</a>().</p>


<h3 class="fn"><a name="setTextInteractionFlags" />QTextEdit.setTextInteractionFlags (<i>self</i>, <a href="qt-textinteractionflags.html">Qt.TextInteractionFlags</a>&#160;<i>flags</i>)</h3><h3 class="fn"><a name="setUndoRedoEnabled" />QTextEdit.setUndoRedoEnabled (<i>self</i>, bool&#160;<i>enable</i>)</h3><h3 class="fn"><a name="setWordWrapMode" />QTextEdit.setWordWrapMode (<i>self</i>, <a href="qtextoption.html#WrapMode-enum">QTextOption.WrapMode</a>&#160;<i>policy</i>)</h3><h3 class="fn"><a name="showEvent" />QTextEdit.showEvent (<i>self</i>, <a href="qshowevent.html">QShowEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#showEvent">QWidget.showEvent</a>().</p>


<h3 class="fn"><a name="tabChangesFocus" />bool QTextEdit.tabChangesFocus (<i>self</i>)</h3><h3 class="fn"><a name="tabStopWidth" />int QTextEdit.tabStopWidth (<i>self</i>)</h3><h3 class="fn"><a name="textBackgroundColor" /><a href="qcolor.html">QColor</a> QTextEdit.textBackgroundColor (<i>self</i>)</h3><p>Returns the text background color of the current format.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qtextedit.html#setTextBackgroundColor">setTextBackgroundColor</a>().</p>


<h3 class="fn"><a name="textColor" /><a href="qcolor.html">QColor</a> QTextEdit.textColor (<i>self</i>)</h3><p>Returns the text color of the current format.</p>
<p><b>See also</b> <a href="qtextedit.html#setTextColor">setTextColor</a>().</p>


<h3 class="fn"><a name="textCursor" /><a href="qtextcursor.html">QTextCursor</a> QTextEdit.textCursor (<i>self</i>)</h3><p>Returns a copy of the <a href="qtextcursor.html">QTextCursor</a>
that represents the currently visible cursor. Note that changes on
the returned cursor do not affect <a href="qtextedit.html">QTextEdit</a>'s cursor; use <a href="qtextedit.html#setTextCursor">setTextCursor</a>() to update the
visible cursor.</p>
<p><b>See also</b> <a href="qtextedit.html#setTextCursor">setTextCursor</a>().</p>


<h3 class="fn"><a name="textInteractionFlags" /><a href="qt-textinteractionflags.html">Qt.TextInteractionFlags</a> QTextEdit.textInteractionFlags (<i>self</i>)</h3><h3 class="fn"><a name="timerEvent" />QTextEdit.timerEvent (<i>self</i>, <a href="qtimerevent.html">QTimerEvent</a>&#160;<i>e</i>)</h3><h3 class="fn"><a name="toHtml" />QString QTextEdit.toHtml (<i>self</i>)</h3><h3 class="fn"><a name="toPlainText" />QString QTextEdit.toPlainText (<i>self</i>)</h3><h3 class="fn"><a name="undo" />QTextEdit.undo (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void undo()</tt>.</p><p>Undoes the last operation.</p>
<p>If there is no operation to undo, i.e. there is no undo step in
the undo/redo history, nothing happens.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qtextedit.html#redo">redo</a>().</p>


<h3 class="fn"><a name="wheelEvent" />QTextEdit.wheelEvent (<i>self</i>, <a href="qwheelevent.html">QWheelEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#wheelEvent">QWidget.wheelEvent</a>().</p>


<h3 class="fn"><a name="wordWrapMode" /><a href="qtextoption.html#WrapMode-enum">QTextOption.WrapMode</a> QTextEdit.wordWrapMode (<i>self</i>)</h3><h3 class="fn"><a name="zoomIn" />QTextEdit.zoomIn (<i>self</i>, int&#160;<i>range</i>&#160;=&#160;1)</h3><p>This method is also a Qt slot with the C++ signature <tt>void zoomIn(int = 1)</tt>.</p><p>Zooms in on the text by making the base font size <i>range</i>
points larger and recalculating all font sizes to be the new size.
This does not change the size of any images.</p>
<p><b>See also</b> <a href="qtextedit.html#zoomOut">zoomOut</a>().</p>


<h3 class="fn"><a name="zoomOut" />QTextEdit.zoomOut (<i>self</i>, int&#160;<i>range</i>&#160;=&#160;1)</h3><p>This method is also a Qt slot with the C++ signature <tt>void zoomOut(int = 1)</tt>.</p><p>This is an overloaded function.</p>
<p>Zooms out on the text by making the base font size <i>range</i>
points smaller and recalculating all font sizes to be the new size.
This does not change the size of any images.</p>
<p><b>See also</b> <a href="qtextedit.html#zoomIn">zoomIn</a>().</p>
<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="copyAvailable" />void copyAvailable (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when text is selected or de-selected in
the text edit.</p>
<p>When text is selected this signal will be emitted with
<i>yes</i> set to true. If no text has been selected or if the
selected text is de-selected this signal is emitted with <i>yes</i>
set to false.</p>
<p>If <i>yes</i> is true then <a href="qtextedit.html#copy">copy</a>() can be used to copy the selection
to the clipboard. If <i>yes</i> is false then <a href="qtextedit.html#copy">copy</a>() does nothing.</p>
<p><b>See also</b> <a href="qtextedit.html#selectionChanged">selectionChanged</a>().</p>


<h3 class="fn"><a name="currentCharFormatChanged" />void currentCharFormatChanged (const QTextCharFormat&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted if the current character format has
changed, for example caused by a change of the cursor position.</p>
<p>The new format is <i>f</i>.</p>
<p><b>See also</b> <a href="qtextedit.html#setCurrentCharFormat">setCurrentCharFormat</a>().</p>


<h3 class="fn"><a name="cursorPositionChanged" />void cursorPositionChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the position of the cursor
changed.</p>


<h3 class="fn"><a name="redoAvailable" />void redoAvailable (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever redo operations become available
(<i>available</i> is true) or unavailable (<i>available</i> is
false).</p>


<h3 class="fn"><a name="selectionChanged" />void selectionChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the selection changes.</p>
<p><b>See also</b> <a href="qtextedit.html#copyAvailable">copyAvailable</a>().</p>


<h3 class="fn"><a name="textChanged" />void textChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the document's content changes;
for example, when text is inserted or deleted, or when formatting
is applied.</p>


<h3 class="fn"><a name="undoAvailable" />void undoAvailable (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever undo operations become available
(<i>available</i> is true) or unavailable (<i>available</i> is
false).</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>